package com.dao;

import com.pojo.User;
import org.apache.ibatis.annotations.*;

import java.util.List;
import java.util.Map;

public interface UserMapper {
    @Select("select * from user")
    List<User>geyUser();

    //方法存在多个参数，所有参数之前必须加上@Param("")注解
    @Select("select * from user id = #{id}")
    User getUserByID(@Param("id")int id);

    @Insert("insert into user(id,name,pwd) values (#(id),#(name),#(password))")
    User addUser(User user);

    @Update("update user set name=#(name),pwd=#(password) where id  = #(id)")
    int update(User user);

    @Delete("delete from user where id #{id}")
    int deleteUser(@Param("uid") int id);

}
